﻿using System;
using System.Data;
using UniMana.Data;

namespace UniMana.Win.Personnel
{
    public partial class FrmCheckSubjectClass_LecturerAll_AddSession_Detail : DevExpress.XtraEditors.XtraForm
    {
        DataTable m_tblTable;
        private DBMain m_data = new DBMain();

        public FrmCheckSubjectClass_LecturerAll_AddSession_Detail(DataTable m_tblTable)
        {
            InitializeComponent();
            this.m_tblTable = new DataTable();
            this.m_tblTable = m_tblTable;
        }

        private void FrmCheckSubjectClass_LecturerAll_AddSession_Detail_Load(object sender, EventArgs e)
        {
            Personnel_PersonnelInfo personinfo = new Personnel_PersonnelInfo(m_tblTable.Rows[0]["Personnel_PersonnelKey"].ToString());
            Training_Subject_ClassInfo classinfo = new Training_Subject_ClassInfo(int.Parse(m_tblTable.Rows[0]["Training_Subject_ClassKey"].ToString()));
            Training_Class_RoomInfo roominfo = new Training_Class_RoomInfo(int.Parse(m_tblTable.Rows[0]["Training_Class_RoomKey"].ToString()));
            Training_WeekDayInfo weekdayinfo = new Training_WeekDayInfo(int.Parse(m_tblTable.Rows[0]["Training_WeekDayKey"].ToString()));
            Training_SessionInfo sessioninfo = new Training_SessionInfo(int.Parse(m_tblTable.Rows[0]["Training_SessionKey"].ToString()));

            txtLessons.Text = m_tblTable.Rows[0]["Lessons"].ToString();
            txtPersonnel_PersonnelID.Text = personinfo.Properties.ID.ToString();
            txtPersonnel_PersonnelName.Text = personinfo.Properties.LastName + " " + personinfo.Properties.Name;
            txtTraining_Class_Room.Text = roominfo.Properties.Name;
            txtTraining_Session.Text = sessioninfo.Properties.Name;
            txtTraining_Subject_ClassID.Text = classinfo.Properties.ID.ToString();
            txtTraining_Subject_ClassName.Text = classinfo.Properties.Name.ToString();
            txtTraining_WeekDay.Text = weekdayinfo.Properties.Name;
            dteRegistTime.EditValue = Convert.ToDateTime(m_tblTable.Rows[0]["RegistTime"].ToString());
        }
    }
}
